<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script src="js/demo4/base64.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/demo4/md5.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/demo4/md4.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/demo4/utf8.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/demo4/sha1.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
// vue中md5加密
// md5
// 1. npm install --save js-md5
// 2. import md5 from 'js-md5'
// 3. md5('holle') //bcecb35d0a12baad472fbe0392bcc043
// 或者在main.js文件中将md5转换成vue原型
// 1. Vue.prototype.$md5 = md5;
// 2. this.$md5('holle') // bcecb35d0a12baad472fbe0392bcc043
// vue中base64加密
// 1. npm install --save js-base64
// 2. let Base64 = require('js-base64').Base64;
// 3. Base64.encode('dankogai');
// 4. Base64.decode('ZGFua29nYWk=');


//		js加密
			let beforeEncry='hello world'
//		1.escape,unescape加解密
//			加密
            let afterEsEncry=escape(beforeEncry)
            console.log('escape:'+afterEsEncry)
//			解密
			let decryptEs = unescape('unescape:'+afterEsEncry)
			console.log(decryptEs)
//		2.base64加解密
//			加密
			let afterBaseEncry = Base64.encode(beforeEncry);
			console.log('base64加密:'+afterBaseEncry)
//			解密
			let decryptBase = Base64.decode(afterBaseEncry)
			console.log('base64解密:'+decryptBase)
//		3.md5加密
			let afterMd5Encry=hex_md5(beforeEncry);
			console.log('md5加密:'+afterMd5Encry)
//		4.md4加密
			let afterMd4Encry = hex_md4(beforeEncry)
			console.log('md4加密:'+afterMd4Encry)
//		5.utf8
//			加密
			let afterUtf8Encry = encodeUTF8(beforeEncry)
			console.log('utf8加密:'+afterUtf8Encry)
//			解密
			let decryptUtf8 = decodeUTF8(beforeEncry)
			console.log('utf8解密:'+decryptUtf8)
//		6.sha1加密
			let afterSha1Encry = hex_sha1(beforeEncry)
			console.log('sha1加密:'+afterSha1Encry)
	</script>
</html>
